home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 21
/
CU Amiga Magazine's Super CD-ROM 21 (1998)(EMAP Images)(GB)[!][issue 1998-04].iso
/
CUCD
/
Programming
/
Python-1.4
/
Python1.4_Source
/
Modules
/
cryptmodule.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-12-15
|
664b
|
44 lines
/* cryptmodule.c - by Steve Majewski
*/
#include "allobjects.h"
#include <sys/types.h>
#ifdef AMITCP
#include <proto/usergroup.h>
#endif
#include "protos/cryptmodule_protos.h"
/* Module crypt */
static object *crypt_crypt(self, args)
object *self, *args;
{
char *word, *salt;
extern char * crypt();
struct passwd *p;
if (!getargs(args, "(ss)", &word, &salt)) {
return NULL;
}
return newstringobject( crypt( word, salt ) );
}
static struct methodlist crypt_methods[] = {
{"crypt", crypt_crypt},
{NULL, NULL} /* sentinel */
};
void
initcrypt()
{
#ifdef AMITCP
if(!checkusergrouplib()) return;
#endif
initmodule("crypt", crypt_methods);
}